<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/page/inc/taglib.jsp"%>
<link rel="stylesheet" href="${pageContext.request.contextPath}/statics/ztree/css/zTreeStyle/zTreeStyle.css"
      type="text/css">
<div class="pageContent">
	<form method="post" id="form" action="${pageContext.request.contextPath}${requestScope.record ==null ?'/customer/shop/insert' :'/customer/shop/update' }" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone);">
		<div class="pageFormContent" layoutH="56">
			<!-- 关闭窗口 -->
			<input type="hidden" name="callbackType" value="closeCurrent" />
			<!-- 隐藏表单 -->
			<c:if test="${requestScope.record !=null}">
				<input type="hidden" name="shopId" value="${requestScope.record.shopId}" />
			</c:if>
			<p>
				<label>店铺号</label> <input name="shopNum" class="required" maxlength="45"  <c:if test="${requestScope.record != null}">readonly="readonly"</c:if> type="text" value="${requestScope.record.shopNum}" />
			</p>
			<p>
				<label>店铺名称</label> <input name="shopName" class="required" maxlength="45"  type="text" value="${requestScope.record.shopName}" />
			</p>
			<p>
				<label>店铺logo</label> <input name="shopLogo" class="required" maxlength="45" type="text" value="${requestScope.record.shopLogo}" />
			</p>
			<p>
				<label>店铺封面</label> <input name="shopCover" class="required" maxlength="45" type="text" value="${requestScope.record.shopCover}" />
			</p>
			<p>
				<label>联系人</label> <input name="contacts" class="required" maxlength="45"  type="text" value="${requestScope.record.contacts}" />
			</p>
			<p>
				<label>联系人号码</label> <input name="contactNumber" class="required phone" maxlength="11"  type="text" value="${requestScope.record.contactNumber}" />
			</p>
			<p>
				<label>手机号码</label> <input name="mobilePhone" class="required phone" maxlength="11"  type="text" value="${requestScope.record.mobilePhone}" />
			</p>
			<p>
				<label>地址</label>
					<input type="hidden" name="areaName" value="">
					<select class="combox" name="areaCode" id="province"  ref="w_combox_city" refUrl="${pageContext.request.contextPath}/system/areas/getCityByProvince?id={value}">
						<option value="all">所有省市</option>
						<c:forEach items="${province }" var="item">
						<option value="${item.id }" ${provinceid == item.id?'selected':''}>${item.name }</option>
						</c:forEach>
					</select>
					<select class="combox" name="areaCode" id="w_combox_city" ref="w_combox_region" refUrl="${pageContext.request.contextPath}/system/areas/getCountyByAreas?id={value}">
						<option value="all">所有城市</option>
						<c:forEach items="${city }" var="item">
						<option value="${item.id }" ${cityid == item.id?'selected':''}>${item.name }</option>
						</c:forEach>
					</select>
					<select class="combox" name="areaCode" id="w_combox_region">
						<option value="all">所有区县</option>
						<c:forEach items="${region }" var="item">
						<option value="${item.id }" ${regionid == item.id?'selected':''}>${item.name }</option>
						</c:forEach>
					</select>
			</p>
			<p>
				<label>详细地址</label> <input name="address" class="required" maxlength="45" type="text" value="${requestScope.record.address}" />
			</p>
			<p>
				<label>邮政编码</label> <input name="postalCode" class="required" maxlength="45" type="text" value="${requestScope.record.postalCode}" />
			</p>
			
			<p>
				<label>店铺状态</label> 
				<select name="shopState" class="combox required">
					<option value=""  ${requestScope.record.shopState==null?'selected':''}>请选择</option>
					<option value="0" ${requestScope.record.shopState==0?'selected':'' }>停用</option>
					<option value="1" ${requestScope.record.shopState==1?'selected':'' }>启用</option>
				</select>
			</p>
			<p>
				<label>允许新增商品</label> 
				<select name="allowAddProduct" class="combox required">
					<option value=""  ${requestScope.record.allowAddProduct==null?'selected':''}>请选择</option>
					<option value="0" ${requestScope.record.allowAddProduct==0?'selected':'' }>不允许</option>
					<option value="1" ${requestScope.record.allowAddProduct==1?'selected':'' }>允许</option>
				</select>
			</p>
<%-- 			<p>
				<label>操作人</label> <input name="operator" class="required" maxlength="45" type="text" value="${requestScope.record.operator}" />
			</p> 
			<p>
				<label>经度</label> <input name="longitude" class="required" maxlength="45" type="text" value="${requestScope.record.longitude}" />
			</p>
			<p>
				<label>纬度</label> <input name="latitude" class="required" maxlength="45" type="text" value="${requestScope.record.latitude}" />
			</p> --%>
			<p>
				<label>员工id</label> <input name="maid" class="required" maxlength="45" type="text" value="${requestScope.record.maid}" />
			</p>
			<p>
				<label>门店状态</label>
					<select name="state" class="combox required">
						<option value=""  ${requestScope.record.state==null?'selected':''}>请选择</option>
						<option value="1" ${requestScope.record.state==1?'selected':''}>新客户</option>
						<option value="2" ${requestScope.record.state==2?'selected':''}>门店建设中</option>
						<option value="3" ${requestScope.record.state==3?'selected':''}>门店配货中</option>
						<option value="4" ${requestScope.record.state==4?'selected':''}>常规客户</option>
					</select>
			</p>
			<p>
				<label>签约时间</label> <input type="text" name="sgtm" class="required date" readonly="true" value="<fmt:formatDate value="${record.sgtm}" pattern="yyyy-MM-dd" />" /><a class="inputDateButton" href="javascript:;">选择</a>

			</p>
			<p>
				<label>客户来源</label> <input name="source" class="required" maxlength="45" type="text" value="${requestScope.record.source}" />
			</p>
			<p>
				<label>店铺面积</label> <input name="ftae" class="required" maxlength="45" type="text" value="${requestScope.record.ftae}" />
			</p>
			<p>
				<label>招商经理</label> <input name="imid" class="required" maxlength="45" type="text" value="${requestScope.record.imid}" />
			</p>
			<p>
				<label>区域经理</label> <input name="rgid" class="required" maxlength="45" type="text" value="${requestScope.record.rgid}" />
			</p>
			<p>
				<label>运营助理</label> <input name="opid" class="required" maxlength="45" type="text" value="${requestScope.record.opid}" />
			</p>
			<p>
				<label>合同编号</label> <input name="ctno" class="required" maxlength="45" type="text" value="${requestScope.record.ctno}" />
			</p>
			<p>
				<label>店铺级别</label> <input name="stle" class="required" maxlength="45" type="text" value="${requestScope.record.stle}" />
			</p>
			<p>
				<label>店铺布局</label> <input name="layout" class="required" maxlength="45" type="text" value="${requestScope.record.layout}" />
			</p>
			<p>
				<label>是否样板店</label> 
				<select name="template" class="combox required">
					<option value=""  ${requestScope.record.template==null?'selected':''}>请选择</option>
					<option value="0" ${requestScope.record.template==0?'selected':''}>否</option>
					<option value="1" ${requestScope.record.template==1?'selected':''}>是</option>
				</select>
			</p>
			<p>
				<label>备注</label> <input name="remk" class="required" maxlength="45" type="text" value="${requestScope.record.remk}" />
			</p>
			<p>
				<label>开业老师</label> <input name="trid" class="required" maxlength="45" type="text" value="${requestScope.record.trid}" />
			</p>
			<p>
				<label>合作等级</label> <input name="cple" class="required" maxlength="45" type="text" value="${requestScope.record.cple}" />
			</p>
			
		</div>
		<div class="formBar">
			<ul>
				<!--<li><a class="buttonActive" href="javascript:;"><span>保存</span></a></li>-->
				<li>
				<div class="buttonActive">
						<div class="buttonContent">
							<button type="submit">保存</button>
						</div>
					</div>
				</li>
				<li>
					<div class="button">
						<div class="buttonContent">
							<button type="button" class="close">取消</button>
						</div>
					</div>
				</li>
			</ul>
		</div>
	</form>
</div>
<script type="text/javascript" src="${pageContext.request.contextPath}/statics/ztree/js/jquery.ztree.core.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/statics/ztree/js/jquery.ztree.excheck.js"></script>
<script>
	$(function(){
		$("[name='areaCode']",$.pdialog.getCurrent()).change(function(){
			var province = $("#province",$.pdialog.getCurrent()).find("option:selected").text();
			var city = $("#w_combox_city",$.pdialog.getCurrent()).find("option:selected").text();
			var region = $("#w_combox_region",$.pdialog.getCurrent()).find("option:selected").text();
			$("[name='areaName']",$.pdialog.getCurrent()).val(province+","+city+","+region);
		});
		
	});
</script>

 